package com.walle.concurrenttest.pattern.threadspecificstorage;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * @author zhangjiapeng
 * @Package com.walle.concurrenttest.pattern.threadspecificstorage
 * @Description: ${todo}
 * @date 2019/2/27 13:49
 */
public class TsLog {


    private PrintWriter printWriter;

    public TsLog(String filename) {
        try {
            printWriter = new PrintWriter(new FileWriter(filename));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public void write(String s){
        printWriter.print(s);
    }


    public void close(){
        System.out.println(" END OF Log ");
        printWriter.close();
    }
}
